/**
 * Copyright HCP Technology 
 * www.hcp.vn
 */
package models;

import java.util.List;

import siena.Id;
import siena.Model;

/**
 * @author numberone
 *
 */
public class HomeAdv extends Model {

	@Id
	public Long id;
	
	public String topAdv;
	public String mainAdv;
	public String leftAdv;
	public String rightAdv;
	public String bottomAdv;
	public String itembeforeAdv;
	public String itemafterAdv;
	public boolean active;
	
	/*get list category*/
	public static List<HomeAdv> find(boolean active){
		return all(HomeAdv.class).filter("active", active).fetch();
	}
	
	public static List<HomeAdv> all(){
		return all(HomeAdv.class).fetch();
	}

	/**
	 * @param Id
	 * @return
	 */
	public static HomeAdv findById(long id) {
		return all(HomeAdv.class).filter("id", id).get();
	}
}
